package com.leyou.common.enums;

import lombok.Getter;

//防置可重复使用的状态码与异常信息
@Getter    //生成Getter方法
public enum  ExceptionEnum {

    //价格不能为空的状态码与消息
    PRICE_CANNOT_BE_NULL(204,"价格不能为空！"),
    CATEGORY_NOT_FOUND(204,"品牌查询为空！"),
    CATEGORY_INSERT_FAIL(500,"种类新增失败！"),
    CATEGORY_DELETE_FAIL(500,"种类删除失败！"),
    DATA_TRANSFER_ERROR(500,"数据转换出错！"),
    BRAND_NOT_FOUND(204,"品牌列表数据未发现！"),
    CATEGORYS_NOT_FOUND(204,"分类列表数据未发现！"),
    INSERT_BRAND_FAIL(500,"新增品牌失败！"),
    INSERT_BRANDCATEGORY_FAIL(500,"新增品牌与种类的联系失败！"),
    INVALID_FILE_TYPE(500,"无效的文件类型！"),
    FILE_TYPE_ERROR(500,"文件类型错误！"),
    FILE_READ_ERROR(500,"文件读取错误！"),
    FILE_NOT_NULL(204,"文件不能为空！"),
    FILE_SAVE_EXCEPTION(500,"文件保存异常！"),
    FILE_UPLOAD_ERROR(500,"文件上传错误！"),
    UPDATE_OPERATION_FAIL(500,"更新操作异常！"),
    INSERT_CATEGORY_FAIL(500,"新增种类失败！"),
    UPDATE_BRAND_FAIL(500,"添加品牌对应分类失败！"),
    INSERT_OPERATION_FAIL(500,"增加操作失败！"),
    RESOURCE_NOT_FOUND(204,"资源未发现异常！"),
    DEFAULT_DELETE_ERROR(500,"删除资源错误！"),
    INSERT_GOODS_FAIL(500,"新增商品失败！"),
    RESOURCE_UPLOAD_FAIL(500,"资源更新失败！"),
    DIRECTORY_WRITER_ERROR(500,"静态页目录创建失败！"),
    FILE_WRITER_ERROR(500,"文件写出异常！"),
    SEND_MESSAGE_ERROR(500,"发送短信失败！"),
    INVALID_PARAM_ERROR(400,"参数有误！"),
    INVALID_PHONE_NUMBER(400,"电话号码有误！"),
    INVALID_USERNAME_PASSWORD(400,"密码或者用户名不存在！"),
    INVALID_VERIFY_CODE(400,"验证码错误！"),
    UNAUTHORIZED(401,"token无效！"),
    INVALID_SERVER_ID_SECRET(500,"服务id或密钥无效！"),
    STOCK_NOT_ENOUGH(500,"库存不足！"),
    ;

    private int status;
    private String message;

    ExceptionEnum(int status,String message){
        this.status = status;
        this.message = message;
    }

}
